package org.zzz.service.impl;

import org.apache.ibatis.session.SqlSession;
import org.zzz.entity.Role;
import org.zzz.mapper.RoleMapper;
import org.zzz.service.RoleService;
import org.zzz.utils.MybatisUtil;

import java.util.List;

/**
 * @Author ZZF
 * @Time 2021/04/20 22:46
 */
public class RoleServiceImpl implements RoleService {
    private RoleMapper roleMapper;

    {
//        SqlSession sqlSession = MybatisUtil.getSqlSession();
        roleMapper = MybatisUtil.getMapper(RoleMapper.class);
    }

    @Override
    public String getRoleNameById(String id) {
        return roleMapper.getRoleNameById(id);
    }

    @Override
    public List<Role> listRole() {
        return roleMapper.listRole();
    }
}
